/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tanks.Controllers;

import tanks.Direction;
import tanks.Game;
import tanks.KeyboardLayout;

/**
 *
 * @author Александр
 */
public class KeyboardController extends Controller
    {
        Game game = Game.Instance();
        KeyboardLayout Layout;
        public  void Control()
        {
            if (game.KeyList[Layout.FireKey])
            {
                tank.Fire();
            }
            else if (game.KeyList[Layout.LeftKey])
            {
                tank.Step(Direction.West);
            }
            else if (game.KeyList[Layout.RightKey])
            {
                tank.Step(Direction.East);
            }
            else if (game.KeyList[Layout.UpKey])
            {
                tank.Step(Direction.North);
            }
            else if (game.KeyList[Layout.DownKey])
            {
                tank.Step(Direction.South);
            }
            else if (game.KeyList[Layout.WeaponKey])
            {
                tank.nextWeap();
            }

        }
        public KeyboardController()
        {
            Layout = new KeyboardLayout();
        }
    }
